
<template>
  <div class="carousel-container">
    <el-carousel trigger="click" style="width: 100%;" height="550px">
      <el-carousel-item v-for="(item, index) in hrefs" :key="index" >
        <!-- <a href="https://www.vmall.com/product/comdetail/index.html?prdId=10086821546239"> -->
            <el-image :src=" Path.imgPath + item.url" fit="contain" style="width: 100%; height: 80%;"></el-image>
          <!-- </a> -->
      </el-carousel-item>
    </el-carousel>
  </div>
</template>

<script setup>
import { ref,computed,watchEffect, reactive } from 'vue';
import Axios from 'axios';
import { get } from '@/plugins/axios'
import { Path } from '@/constant';
console.dir(Path.imgPath)

const hrefs= ref([])
updateGoods()
function updateGoods(){
  get('/advertising/getPictures',null,content => {
    hrefs.value = content
  })
	// Axios.request({
	// 	url:"http://10.25.128.192:8080/advertising/getPictures",					//从后端接收数据，商品库新品图片
	// 	method:'get'
	// }).then(response=>{
	// 	// goods.value=response.data.map(item => ({ url: item }))//后端传递的是数组，在前端转为json接收
  //   console.dir(response)
  //   hrefs.value = response.data.content
  //   console.dir(hrefs.value)
	// })
}  
</script>

<style scoped lang="scss">
 .carousel-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  
  .el-carousel {
    width: 100%;
    height: 100%;
  } 
  
 

	
	} 

</style>
